package com.dcd.service;

import com.dcd.pojo.Follow_user;
import com.dcd.service.impl.Follow_userServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(name = "donchedi-provider9091",fallback = Follow_userServiceImpl.class,contextId = "followuser")
public interface Follow_userService {

    /**
     * 查询所有关注的用户(根据登录用户id查询)
     * @param follow_user_id 登录用户id
     * @return
     */
    @RequestMapping("/select_Follow_user")
    public List<Follow_user> select_Follow_user(@RequestParam int follow_user_id);

    /**
     * 根据登入id查询用户详情
     * @param user_id 用户登入id
     * @return
     */
    @RequestMapping("/select_ById")
    public Follow_user select_ById(@RequestParam int user_id);

    /**
     * 根据被关注id查询粉丝数
     * @param cover_id 被关注id
     * @return
     */
    @RequestMapping("/select_By_CoverId")
    public Follow_user select_By_CoverId(@RequestParam int cover_id);

    /**
     * 根据条件添加，取消关注
     * @param follow_user 关注用户表的对象
     * @return
     */
    @RequestMapping("/insert_or_delete_follow_user_id")
    public String insert_or_delete_follow_user_id(@RequestBody Follow_user follow_user,@RequestParam String type);

    /**
     * 查询用户是否关注指定用户
     * @param follow_user
     * @return
     */
    @RequestMapping("/select_user_follow_user")
    public String select_user_follow_user(@RequestBody Follow_user follow_user);
}
